package com.example.demo.day0228;

enum Season  implements IEnum{//枚举类和普通类一样可以实现一个或多个接口
    SPRING("spring","warm"),
    SUMMER("summer","hot"),
    AUTUMN("autumn","windy"),//eunm类中必须先定义实例，在定义方法
    WINTER("winter","cold");//调用下方的含参数的私有构造
    private  String name;
    private  String desc;//final一定要被初始化，只能存在一个构造方法

    private Season(String name, String desc){
        this.name= name;
        this.desc=desc;
    }

    Season() {
    }

    public void showInfo(){
        System.out.println(this.name+" is "+this.desc);
    }

    public void test() {
        System.out.println("implements IEnum.test");
    }


}
interface IEnum{
    void test();
}

//class A extends Season{}//枚举类不能被继承
